# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=androick
pkgver=8.522cfb4
pkgrel=3
groups=('blackarch' 'blackarch-mobile' 'blackarch-forensic')
pkgdesc='A python tool to help in forensics analysis on android.'
arch=('any')
url='https://github.com/Flo354/Androick'
license=('GPL3')
depends=('python2' 'python2-magic' 'sqlite' 'android-sdk-build-tools'
         'android-sdk-platform-tools' 'android-sdk')
makedepends=('git')
source=("$pkgname::git+https://github.com/Flo354/Androick.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" changelog README.md

  rm README changelog

  cp -a * "$pkgdir/usr/share/$pkgname"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

